import request from '@/utils/request'

// 查询目标分页
export function pageTarget(query) {
  return request({
    url: '/risk/target/audit/page',
    method: 'get',
    params: query,
    factoryId:true,
  })
}

// 查询目标列表
export function listTarget(query) {
  return request({
    url: '/risk/audit/list',
    method: 'get',
    params: query,
    factoryId:true
  })
}

// 查询目标详细
export function getTarget(id) {
  return request({
    url: '/risk/target/info/' + id,
    method: 'get'
  })
}

// 新增目标
export function addTarget(data) {
  return request({
    url: '/risk/target',
    method: 'post',
    data: data,
    factoryId:true,
  })
}

// 修改目标
export function updateTarget(data) {
  return request({
    url: '/risk/target',
    method: 'put',
    data: data
  })
}

// 删除目标
export function delTarget(data) {
  return request({
    url: '/risk/target/remove/batch',
    method: 'delete',
    data
  })
}

// 导出目标
export function exportTarget(query) {
  return request({
    url: '/risk/target/export',
    method: 'get',
    params: query
  })
}

// 下载模板目标
export function downImportTemplate() {
  return request({
    url: '/risk/target/importTemplate',
    method: 'get'
  })
}

// 审核通过
export function pass(id) {
  return request({
    url: `/risk/target/audit/pass/${id}`,
    method: 'post'
  })
}

// 审核驳回
export function reject(id) {
  return request({
    url: `/risk/target/audit/reject/${id}`,
    method: 'post'
  })
}




